-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server): multi region module base w/ a test (mocked) mutation #3406
Conversation
@@ -25,7 +25,6 @@ generates: | |||
User: '@/modules/core/helpers/graphTypes#UserGraphQLReturn' | |||
ActiveUserMutations: '@/modules/core/helpers/graphTypes#MutationsObjectGraphQLReturn' | |||
UserEmailMutations: '@/modules/core/helpers/graphTypes#MutationsObjectGraphQLReturn' | |||
UserWorkspaceMutations: '@/modules/core/helpers/graphTypes#MutationsObjectGraphQLReturn' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GQL type no longer exists
@@ -77,7 +78,8 @@ const getEnabledModuleNames = () => { | |||
'serverinvites', | |||
'stats', | |||
'webhooks', | |||
'workspacesCore' | |||
'workspacesCore', | |||
'multiregion' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned before, the module itself is enabled always (for simplicity), but then functionality checks inside of it can use the feature flag
@@ -93,7 +95,13 @@ async function getSpeckleModules() { | |||
const moduleNames = getEnabledModuleNames() | |||
|
|||
for (const dir of moduleNames) { | |||
loadedModules.push(require(`./${dir}`)) | |||
const moduleIndex = await import(`./${dir}/index`) | |||
const moduleDefinition = 'init' in moduleIndex ? moduleIndex : moduleIndex.default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally supporting export default {}
in module index files, no longer having to do any of this export = {}
bullshit
@@ -185,7 +193,10 @@ const graphComponents = (): Pick<ApolloServerOptions<any>, 'resolvers'> & { | |||
// first pass load of resolvers | |||
const resolversPath = path.join(fullPath, 'graph', 'resolvers') | |||
if (fs.existsSync(resolversPath)) { | |||
resolverObjs = [...resolverObjs, ...values(autoloadFromDirectory(resolversPath))] | |||
const newResolverObjs = values(autoloadFromDirectory(resolversPath)).map((o) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly supporting export default {}
in GQL resolver modules
@@ -0,0 +1,12 @@ | |||
export type RegionServerConfig = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated based on Iain's proposed schema
@@ -0,0 +1,5 @@ | |||
import { Resolvers } from '@/modules/core/graph/generated/graphql' | |||
|
|||
// TODO: Real implementation? Need to discuss questions regarding data model & region config first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got my answers earlier today, so I should be unblocked for this
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
No description provided.